package com.atguigu.mock.entity;

import com.atguigu.common.base.entity.AutoIdBase;
import com.atguigu.common.comment.Comment;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import java.time.LocalDateTime;

@Entity
@Getter
@Setter
@NoArgsConstructor
@Comment("菜品属性值表")
public class ProductSpuAttrValue extends AutoIdBase {
    @Comment("所属菜品")
    @ManyToOne
    private ProductSpu productSpu;
    @Comment("属性ID")
    @ManyToOne
    private ProductSpuAttr productSpuAttr;
    @Comment("属性值")
    private String attrValue;

    public ProductSpuAttrValue(LocalDateTime createTime, ProductSpuAttr productSpuAttr, String attrValue) {
        super(createTime);
        this.productSpu = productSpuAttr.getProductSpu();
        this.productSpuAttr = productSpuAttr;
        this.attrValue = attrValue;
    }
}
